package toolNet
{
	public class Model
	{
		private static var _Instance	:	Model;
		
		private var _connection		: 	Connection;
		private var _service			:	Service;
		
		private var _start				:	Boolean;
		
		public function Model()
		{
			init();
		}
		
		private function init():void
		{
			_connection	=	new Connection();
			_service	=	new Service(_connection);
		}
		
		public static function getInstance():Model
		{
			if(_Instance == null)
			{
				_Instance	=	new Model();
			}
			return _Instance;
		}
		
		public function connect(connectName : String):void
		{
			if(!_start)
			{
				_connection.createConnection("_" + connectName);
				_start	=	true;
			}
		}
		
		public function startTool():void
		{
			_connection.start	=	true;
		}

		public function get service():Service
		{
			return _service;
		}
	}
}